/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package org.beiyou;

import java.util.Random;

/**
 * <p>Project: javase202202 - Rand1
 * <p>Powered by Lisi On 2022-05-30 17:33:34
 * <p>Created by IntelliJ IDEA
 *

 * @version 1.0
 * @since 17
 */
public class Rand1 {
    public static void main(String[] args) {

        //0.8332761278774027
        System.out.println(Math.random());

        Random rand = new Random();
        System.out.println(rand.nextBoolean());//true false

        //0-9 随机整数
        System.out.println(rand.nextInt(10));
        System.out.println(rand.nextDouble());
        System.out.println(rand.nextLong());
        System.out.println(rand.nextFloat());

    }
}
